/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Request;

import Request.RequestType;
import AccManager.UserProfile;
import java.net.*;

/**
 *
 * @author lcy
 */
public class RegisterRequest extends Request {

    protected UserProfile _usr_profile;

    public RegisterRequest(){
        super(RequestType.REGISTRATION);
        _usr_profile=null;
        InitCommComponents();
    }

    public RegisterRequest(UserProfile profile){
        super(RequestType.REGISTRATION);
        _usr_profile = new UserProfile(profile);
        InitCommComponents();
    }

    public RegisterRequest(RegisterRequest request){
        super(request);
        _usr_profile = new UserProfile(
                (UserProfile)(request.GetRequestContent()));
    }

    private void InitCommComponents(){
        
    }

     public UserProfile GetRequestContent(){
         return _usr_profile;
     }

     @Override
     public void SetLocalInetAddr(InetAddress addr){
          _local_ip_addr = addr;
          _usr_profile.SetUserIP(addr);
    }

    @Override
    public void SetLocalPort(int port){
        _local_port = port;
        _usr_profile.SetUserPort(port);
    }
}
